package com.neusoft.elmboot.mapper;

import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.neusoft.elmboot.po.WalletTrans;

@Mapper
public interface WalletTransMapper {
    @Insert("insert into walletTrans values(null, #{outId}, #{toId}, #{time}, #{money}, 'pay', #{userId})")
    public int saveTransByPay(WalletTrans vir);

    @Insert("insert into walletTrans values(null, #{outId}, 88, #{time}, #{money}, 'withdrawal', #{userId})")
    public int saveTransByWithdrawal(WalletTrans vir);

    @Insert("insert into walletTrans values(null, 00, #{toId}, #{time}, #{money}, 'recharge', #{userId})")
    public int saveTransByRecharge(WalletTrans vir);

    @Select("select * from walletTrans where userId = #{userId}")
    public List<WalletTrans> listWalletTransByUserId(String userId);
}
